package com.sun.weekend.view;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.GridView;

import com.sun.weekend.util.LogUtils;

/**
 * @author Administrator
 */

public class FixedGridView extends GridView{

    public FixedGridView(Context context) {
        this(context,null);
    }

    public FixedGridView(Context context, AttributeSet attrs) {
        this(context, attrs,0);
    }

    public FixedGridView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        int mode = MeasureSpec.getMode(heightMeasureSpec);
        int size = MeasureSpec.getSize(heightMeasureSpec);
        LogUtils.logi(mode+"   "+size);
        int expandSpec = MeasureSpec.makeMeasureSpec(1<<30-1,
                MeasureSpec.AT_MOST);
        super.onMeasure(widthMeasureSpec, expandSpec);
    }
}
